<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:84:"/data/www/html/web2017/public_html/../application/index/view/usercenter/dynamic.html";i:1498807262;s:80:"/data/www/html/web2017/public_html/../application/index/view/footer_dynamic.html";i:1493372448;}*/ ?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>树人100-微信UI-1.0</title>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <!--<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">-->
    <link rel="stylesheet" href="__STATIC__/style/weui.min.css">
    <link rel="stylesheet" href="__STATIC__/style/cmgd.css">
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script src="/static/admin/js/plugins/layer/laydate/laydate.js"></script>
    <script src="/static/pc/js/layer/layer.js"></script>
    <script src="/static/admin/js/laypage/laypage.js"></script>
    <script src="/static/admin/js/laytpl/laytpl.js"></script>

    <!--奥森图标-->
    <link rel="stylesheet" href="__STATIC__/style/FontAwesome_4.2.0/css/font-awesome.min.css">
    <style>
        .weui-media-box__title{color: #000;}
        .weui-media-box__desc{color: #000; }
        .text{padding-left:9px; }
        .fa-list-ul{padding-right:3px;}
        .weui-media-box__desc img{width:16px;height:16px;margin-bottom:-3px;}
        .weui-navbar{top:5px;}
        .weui-navbar+.weui-tab__panel{
            padding-top: 62px;
            padding-bottom: 60px;
        }
        .weui-grid__icon {width:95%; }
        .imgs{float:left;width: 33%;}
        .content{font-size:14px;}
        .desc{text-align:left; padding: 10px 15px 0 20px;font-size:13px; }
        .name{color:#2fab87;font-size:13px;}
        .addTime{color:#999;}
        .button-sp-area{padding: 0 0 5px 0;}
        .fa-meh-o{fonti-size:30px;color: #ccc;}
        .weui-textarea{text-align:left;}
        .blue{color:blue;}
        .weui-grid:after{border:0px;}
        .weui-grid:before{border:0px;}
        .weui-grid{padding:3px 0px;}
        .weui-grids{padding:8px 8px;}
        .username{font-size:15px;}
    </style>
</head>
<body>

<div class="container" id="container">

    <!--顶部搜索-->
    <div class="page home js_show">

        <div class="page__bd" style="height: 100%;">
            <!--选择导航-->
            <div class="weui-tab" id="navbar">


                <div class="weui-navbar">
                    <div class="weui-navbar__item weui-bar__item_on">我的圈子</div>
                </div>


                <div class="weui-tab__panel">
                        <script id="list-template" type="text/html">
                            {{# for(var i=0;i<d.length;i++){  }}
                            <div class="weui-panel articlelist">
                                <div class="weui-panel__hd">
                                    <A href="/index/user/user_info/user_id/{{d[i].user_id}}.html">
                                    <img src="/uploads/face/{{d[i].head_img}}" class="headPic">
                                    <div class="userName">
                                        <h4 class="weui-media-box__title username">{{d[i].nickname}}</h4>
                                        <p class="weui-media-box__desc addTime">{{d[i].addtime}}</p>
                                    </div>
                                </div>
                                <div class="weui-panel__bd">
                                    <div class="weui-media-box weui-media-box_text">
                                        <p class="weui-media-box__desc content" >
                                            {{d[i].content}}
                                        </p>
                                    </div>
                                </div>


                                {{# if(d[i].img!=''){ }}
                                <div class="weui-grids">

                                {{# for(var k=0;k< d[i].imgs.length;k++){  }}

                                            <a href="javascript:;" class="weui-grid">
                                                <div class="weui-grid__icon">
                                                    <img src="/uploads/images/{{d[i].imgs[k].imgpath}}" alt="" >
                                                </div>
                                            </a>


                                    {{# } }}
                                </div>
                                {{# } }}


                                {{# if(d[i].share_id>0){ }}

                                <div class="weui-panel__bd" style="background: #f3f0f0;">
                                    <div class="weui-media-box weui-media-box_text">
                                        <p class="weui-media-box__desc content" >
                                           <span class="blue">@{{d[i].sharename}}  </span>{{d[i].sharecontent}}
                                        </p>
                                    </div>
                                </div>

                                    {{# if(d[i].share_img!=''){ }}
                                    <div class="weui-grids" style="background: #f3f0f0;">

                                        {{# for(var q=0;q< d[i].share_imgs.length;q++){  }}

                                        <a href="javascript:;" class="weui-grid">
                                            <div class="weui-grid__icon">
                                                <img src="/uploads/images/{{d[i].share_imgs[q].imgpath}}" alt="" >
                                            </div>
                                        </a>


                                        {{# } }}
                                    </div>
                                    {{# } }}



                                {{# } }}

                                <div class="weui-form-preview__ft">

                                    <a class="weui-form-preview__btn weui-form-preview__btn_default" href="javascript:"><i
                                            class="fa fa-external-link" onclick="shares({{d[i].id}})"> {{d[i].shares}}</i></a>
                                    <a class="weui-form-preview__btn weui-form-preview__btn_default" id="comment1"
                                       onclick="comment('{{d[i].id}}',this)"><i class="fa fa-comment-o" id="coll_{{d[i].id}}">{{d[i].pinglun}}</i>
                                    </a>
                                    <a class="weui-form-preview__btn weui-form-preview__btn_default no"
                                       onclick="thumbsUp('{{d[i].id}}',this)"><i class="fa {{# if(d[i].is_zan==1){ }}fa-thumbs-up{{# }else{ }}fa-thumbs-o-up{{# } }}" id="zan_{{d[i].id}}">{{d[i].zan}}</i></a>


                                </div>
                                <div class="weui-form-preview__ft "  >
                                    <div class="weui-cells weui-cells_form comment" id="pl_{{d[i].id}}" style="display: none">
                                        <div  id="pp_{{d[i].id}}">
                                        {{# for(var j=0;j< d[i].comment.length;j++){  }}
                                            <div class="weui-cell__bd huifu">
                                                    <p class="weui-media-box__desc desc"><b class="name">{{d[i].comment[j].nickname}}：</b> {{d[i].comment[j].content}}</p>
                                            </div>
                                        {{# } }}
                                        </div>
                                        <div class="weui-cell" style="margin-top: 5px;">
                                            <div class="weui-flex__item">
                                                <div id="comment_{{d[i].id}}" class="weui-textarea" contenteditable="true" style="height:50px; overflow: auto;"></div>
                                            </div>
                                            <div class="" style="font-size: 22px;">
                                                <a href="javascript:;" onclick="showemoji({{d[i].id}})"><i class="fa fa-meh-o" style="font-size: 22px;"></i></a>
                                            </div>
                                        </div>
                                        <div id="emoji_{{d[i].id}}" class="emoji"  style="background:#fff; margin-top:10px;padding: 5px 0;display:none;text-align: left;">
                                            <a href="javascript:;" onclick="addemoji(1,{{d[i].id}})"> <span><img src="/static/emoji/img/1.gif"></span> </a>
                                            <a href="javascript:;" onclick="addemoji(2,{{d[i].id}})"><span><img src="/static/emoji/img/2.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(3,{{d[i].id}})"><span><img src="/static/emoji/img/3.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(4,{{d[i].id}})"><span><img src="/static/emoji/img/4.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(5,{{d[i].id}})"><span><img src="/static/emoji/img/5.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(6,{{d[i].id}})"><span><img src="/static/emoji/img/6.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(7,{{d[i].id}})"><span><img src="/static/emoji/img/7.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(8,{{d[i].id}})"><span><img src="/static/emoji/img/8.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(9,{{d[i].id}})"><span><img src="/static/emoji/img/9.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(10,{{d[i].id}})"><span><img src="/static/emoji/img/10.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(11,{{d[i].id}})"><span><img src="/static/emoji/img/11.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(12,{{d[i].id}})"><span><img src="/static/emoji/img/12.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(13,{{d[i].id}})"><span><img src="/static/emoji/img/13.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(14,{{d[i].id}})"><span><img src="/static/emoji/img/14.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(15,{{d[i].id}})"><span><img src="/static/emoji/img/15.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(16,{{d[i].id}})"><span><img src="/static/emoji/img/16.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(17,{{d[i].id}})"><span><img src="/static/emoji/img/17.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(18,{{d[i].id}})"><span><img src="/static/emoji/img/18.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(19,{{d[i].id}})"><span><img src="/static/emoji/img/19.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(20,{{d[i].id}})"><span><img src="/static/emoji/img/20.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(21,{{d[i].id}})"><span><img src="/static/emoji/img/21.gif"></span></a>
                                            <a href="javascript:;" onclick="addemoji(22,{{d[i].id}})"><span><img src="/static/emoji/img/23.jpg"></span></a>
                                        </div>
                                        <div class="button-sp-area"><a href="javascript:;" onclick="submit({{d[i].id}})"  class="weui-btn weui-btn_mini weui-btn_primary">提交评论</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            {{# } }}
                        </script>
                    <div id="list-content"></div>
                </div>
            </div>

        </div>
    </div>

    <div class="weui-tabbar footer" >
    <a href="<?php echo url('index/index'); ?>" class="weui-tabbar__item <?php if($footfrom ==1): ?>weui-bar__item_on <?php endif; ?>"" >
                        <span style="display: inline-block;position: relative;">
                            <i class="fa fa-home weui-tabbar__icon"></i>
                        </span>
        <p class="weui-tabbar__label">首页</p>
    </a>
    <a href="<?php echo url('usercenter/send_info'); ?>" class="weui-tabbar__item <?php if($footfrom ==2): ?>weui-bar__item_on <?php endif; ?>"">
                        <span style="display: inline-block;position: relative;">
                            <i class="fa fa-plus weui-tabbar__icon"></i>
                            <!--<span class="weui-badge weui-badge_dot" style="position: absolute;top: 0;right: -6px;"></span>-->
                        </span>
        <p class="weui-tabbar__label">发动态</p>
    </a>
    <a href="<?php echo url('usercenter/index'); ?>" class="weui-tabbar__item <?php if($footfrom ==3): ?>weui-bar__item_on <?php endif; ?>"">
                        <span style="display: inline-block;position: relative;">
                            <i class="fa fa-user weui-tabbar__icon"></i>
                                <!--<span class="weui-badge" style="position: absolute;top: -2px;right: -6px;">8</span>-->
                        </span>
        <p class="weui-tabbar__label">我的</p>

    </a>
</div>

</div>
</body>

<script type="text/javascript">






    var ccc =1;
    Ajaxpage();
    $(window).scroll(
            function() {
                var scrollTop = $(this).scrollTop();
                var scrollHeight = $(document).height();
                var windowHeight = $(this).height();
                if (scrollTop + windowHeight == scrollHeight) {
                    Ajaxpage();
                }
            });

    function Ajaxpage(){
        $.post('<?php echo url("usercenter/dynamic"); ?>', {page:ccc}, function(data){
            //  $(".spiner-example").css('display','none'); //数据加载完关闭动画

            if(data.code==1){
                // $("#list-content").html('<td colspan="20" style="padding-top:10px;padding-bottom:10px;font-size:16px;text-align:center">暂无数据</td>');
                var tpl = document.getElementById('list-template').innerHTML;
                laytpl(tpl).render(data.list, function(html){
                    document.getElementById('list-content').innerHTML = html;
                    $('#list-content').append(html);
                    $('.weui-grid__icon').css('height',$('.weui-grid__icon').css('width'));
                    ccc++;
                });
            }else{

            }
        });
    }

//    $(function(){
//
//
//
//
//
//        var $searchBar = $('#searchBar'),
//                $searchResult = $('#searchResult'),
//                $searchText = $('#searchText'),
//                $searchInput = $('#searchInput'),
//                $searchClear = $('#searchClear'),
//                $searchCancel = $('#searchCancel');
//
//        function hideSearchResult(){
//            $searchResult.hide();
//            $searchInput.val('');
//        }
//        function cancelSearch(){
//            hideSearchResult();
//            $searchBar.removeClass('weui-search-bar_focusing');
//            $searchText.show();
//        }
//
//        $searchText.on('click', function(){
//            $searchBar.addClass('weui-search-bar_focusing');
//            $searchInput.focus();
//        });
//        $searchInput
//                .on('blur', function () {
//                    if(!this.value.length) cancelSearch();
//                })
//                .on('input', function(){
//                    if(this.value.length) {
//                        $searchResult.show();
//                    } else {
//                        $searchResult.hide();
//                    }
//                })
//        ;
//        $searchClear.on('click', function(){
//            hideSearchResult();
//            $searchInput.focus();
//        });
//        $searchCancel.on('click', function(){
//            cancelSearch();
//            $searchInput.blur();
//        });
//    });
    //顶部导航
    $(function(){
        $('.weui-navbar__item').on('click', function () {
            $(this).addClass('weui-bar__item_on').siblings('.weui-bar__item_on').removeClass('weui-bar__item_on');

            var cc = $(this).text();
            if(cc=='官方动态'){
                $("#wzzx").hide();
                $("#gfdt").show();

            }
            if(cc=='文章中心'){
                $("#wzzx").show();
                $("#gfdt").hide();

            }
        });
    });
//    //底部导航
//    $(function(){
//        $('.weui-tabbar__item').on('click', function () {
//            $(this).addClass('weui-bar__item_on').siblings('.weui-bar__item_on').removeClass('weui-bar__item_on');
//        });
//    });

    //点赞
    function thumbsUp(id,obj){

        var t = '#zan_'+id;
         count = $(t).html();
        $.post('<?php echo url("usercenter/dynamic_zan"); ?>',
                {id:id},
                function(data){
                    if(data.code==11){
                        layer.msg(data.msg,{icon:5,time:1500,shade: 0.1,});
                        window.location.href="<?php echo url('user/login'); ?>";
                    }else {

                        count = parseInt(count);


                        if(data.code==1){
                            count = count+1;
                            $('#zan_'+id).removeClass('fa-thumbs-o-up');
                            $('#zan_'+id).addClass('fa-thumbs-up');
                            $('#zan_'+id).html(count);
                        }else{
                            count = count-1;
                            $('#zan_'+id).removeClass('fa-thumbs-up');
                            $('#zan_'+id).addClass('fa-thumbs-o-up');
                            $('#zan_'+id).html(count);
                        }
                    }

                });







    }

    function comment(id,obj){
       var t = '#pl_'+id;
        var st = $(t).css('display');
        if(st=='none'){
            $('.comment').css('display','none');
            $(t).css('display','block');
        }else{
            $(t).css('display','none');
        }
    }


    function addemoji(i,j){
        var htl = "<img src='/static/emoji/img/"+i+".gif'>";
        $("#comment_"+j).append(htl);
    }



    function shares(id){

        location.href = '/index/usercenter/send_info/share_id/'+id+'.html';
    }

    function showemoji(id){
        var t = '#emoji_'+id;
        var st = $(t).css('display');
        if(st=='none'){
            $('.emoji').css('display','none');
            $(t).css('display','block');
        }else{
            $(t).css('display','none');
        }
    }


    function submit(i){
        var text =  $("#comment_"+i).html();
        if(text==''){
            layer.msg('评论不能为空',{icon:5,time:1000,shade: 0.1,});
            return false;
        }
        $.post('<?php echo url("usercenter/send_comment"); ?>',
                {content:text,id:i},
                function(data){
                    if(data.code==1) {
                        layer.msg(data.msg,{icon:1,time:1000,shade: 0.1,});

                        var nickname='<?php echo $nickname; ?>';
                        var htm ="<div class='weui-cell__bd huifu'><p class='weui-media-box__desc desc'><b class='name'>"+nickname+"：</b> "+text+"</p></div>";

                        $('#pp_'+i).append(htm);
                        $("#comment_"+i).html('');
                        $('#emoji_'+i).hide();

                        var t = '#coll_'+i;
                        count = $(t).html();
                        count = parseInt(count);
                        count =count+1;
                        $(t).html(count);



                    }else{
                        layer.msg(data.msg,{icon:5,time:1000,shade: 0.1,});
                    }

//
//
//                    $("#myform").html('');
//                    $('#emoji').hide();
                });

    }


</script>

</html>